<div id="conceptsPage">
    <div class="post">
        <h2 class="title">Concept</h2>
        <div class="entry">
            <input type="button" value="Add new" onclick="show('#new_concept')"/>

            <?php
         //   if ($this->session->userdata("admin")) {
            ?>
                <input type="button" value="Search" onclick="show('#searchConcepts')"/>
                <input type="button" value="Clear Search" onclick="clearSearch()"/>
            <?php
         //   }
            ?>

            <div id="concept_result" class="info">
                <?= $message ?>
            </div>

            <script>
                $(function() {
                    $( "#concept_datepicker" ).datepicker({ dateFormat: 'yy-mm-dd' });
                });
            </script>
            <script type="text/javascript">
                function searchConcepts(){
                    field=document.getElementById("searchConceptsForm").field.value;
                    search=document.getElementById("searchConceptsForm").search.value;
                    $("#conceptsPage").load("<?= base_url(); ?>index.php?/admin_mis/concepts/"+field+"/"+search);
                }
                function clearSearch(){
                    $("#conceptsPage").load("<?= base_url(); ?>index.php?/admin_mis/concepts/");
                }
            </script>
            <!--a href="" id="hide3" >Hide</a> <a href="" id="show3" >Show</a-->
            <div id="new_concept" style="display: none;margin-bottom: 10px;">
                <?php $data['id'] = "concept_form" ?>
                <?= form_open_multipart('mis/saveConcept', $data); ?>
                <table>
                    <tr class="darker"><td class="half">Title</td><td><input type="text" class="wide" name="title" value="<?php echo set_value('title'); ?>" /></td> </tr>
                    <tr class="lighter"><td class="half">Date sent/submitted</td><td><input type="text" class="wide" name="date_sent" value="<?php echo set_value('date_sent'); ?>" id="concept_datepicker"/></td> </tr>
                    <tr class="darker"><td class="half">Sent to</td><td><input type="text" class="wide" name="sent_to" value="<?php echo set_value('sent_to'); ?>" /></td> </tr>
                    <tr class="lighter"><td class="half">Contacts</td><td><input type="text" class="wide" name="contacts" value="<?php echo set_value('contacts'); ?>" /></td> </tr>
                    <tr class="darker"><td>Upload concept note</td><td><input type="file" class="wide"  name="userfile" /></td> </tr>

                    <tr><td colspan="2" style="text-align: right">
                            <input type="submit" value="Submit" />
                            <input type="button" value="Cancel" onclick="hide('#new_concept')"/>
                        </td></tr>
                </table>
                </form>
            </div>



            <div id="searchConcepts" style="display: none;margin-bottom: 10px;">
                <form id="searchConceptsForm">
                    <table>
                        <tr class="darker"><td class="half">Select search criteria</td>
                            <td><select name="field">
                                    <option  value='all'>All</option>
                                    <option  value='title'>Title</option>
                                    <option  value='contacts'>Contacts</option>
                                    <option value='sent_to' >Sent to</option>
                                    <option  value='added_by'> Added by</option>
                                </select></td>
                            <td><input type="text" name="search" class="wide"  value="<?php echo set_value('added_by'); ?>" /></td>
                        </tr>

                        <tr><td colspan="3" style="text-align: right">
                                <input type="button" value="Submit" onclick="searchConcepts()" />
                                <input type="button" value="Cancel" onclick="hide('#searchConcepts')"/>
                            </td></tr>

                    </table>
                </form>
            </div>

            <div id="all_concepts">
                <?= $tablet ?>
                <?= $pagina ?>
            </div>

        </div>
    </div>
</div>